/**
 * 作者：I-AM-WASTE
 * TIME:2022-10-12
 */

let v = new Vue({
    el:"#nrbody",
    data:{
        artWord:{
            id:'',
            articleId:'',
            visitorName:'',
            commentContent:'',
        }
    },
    created:function (){
        axios.post("/back/plaite/0").then(function (response){
            v.artWord = response.data
        })
    },
    methods:{
        page(index){
            axios.post("/back/plaite/"+index).then(function (response){
                v.artWord = response.data
            })
        },
        deldown(index){
            axios.post("/back/plaite/"+index).then(function (response){
                location.reload();
            })
        },

    }
})

let z = new Vue({
    el:"#hander-finx",
    data:{
        i:null
    },
    methods: {
        loginout(){
            axios.post("/loginout").then(function (response){
                z.$Message.success({
                    content: "退出成功！（；´д｀）ゞ",
                    duration: 3
                });
                this.i = setTimeout(()=>{
                    //需要延迟的代码 :3秒后延迟跳转到首页，可以加提示什么的
                    window.location.href = "/login"
                    //延迟时间：3秒
                },3000)
            })
        }
    },
    beforeDestroy(){
        clearTimeout(this.i)
    }
})



let year = document.getElementById("newyear")
year.innerText = ""+new Date().getFullYear()+""